-- GENERATED SPELL FOR [Pit Commander] --


function spell0_18945(pUnit, Event) --@Cleave,n/a--
pUnit:FullCastSpellOnTarget(16044,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18945', 617, 1)
end

function spell1_18945(pUnit, Event) --@Rain of Fire,n/a--
pUnit:FullCastSpellOnTarget(33627,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18945', 9000, 1)
end

function spell2_18945(pUnit, Event) --@Summon Infernals,Self--
pUnit:FullCastSpellOnTarget(33393,pUnit)
pUnit:RegisterEvent('Sorts_18945', 542, 1)
end

function Sorts_18945(pUnit, Event)
local choix_sorts_18945 = math.random(0, 2)
if choix_sorts_18945 == 0 then
pUnit:RegisterEvent('spell0_18945', 1, 1)
end
if choix_sorts_18945 == 1 then
pUnit:RegisterEvent('spell1_18945', 1, 1)
end
if choix_sorts_18945 == 2 then
pUnit:RegisterEvent('spell2_18945', 1, 1)
end
end

function mob18945_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_18945', math.random(1500, 3000), 1)
end

function mob18945_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18945_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18945_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(18945, 1, 'mob18945_Action')
RegisterUnitEvent(18945, 2, 'mob18945_Leave')
RegisterUnitEvent(18945, 3, 'mob18945_Kill')
RegisterUnitEvent(18945, 4, 'mob18945_Die')
